package com.tony.mulitithread.controller;

import com.tony.mulitithread.domain.FileInfo3;
import com.tony.mulitithread.mapper.File3Mapper;
import com.tony.mulitithread.service.FileService;

import java.util.List;
import java.util.concurrent.CountDownLatch;

public class InsertFile implements Runnable{

    private List<FileInfo3> list;
    private FileService fileService;

    public InsertFile() {
    }

    public InsertFile(List<FileInfo3> list, FileService fileService) {
        this.list = list;
        this.fileService = fileService;
    }

    @Override
    public void run() {
        try {
            //具体要执行的操作数据库的代码
            fileService.insertBatch3(list);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
